Calendar Slicers
The calendar slicer is a specialized slicer for date-time columns coming from a SQL database, especially where the classic date-time data groups (quarter, semester, year, month, week) don't exist. The slicer enables you to filter the query by these groups, without the need to construct any complex formulations. This is an excellent solution for users who are directly querying a SQL database, and cannot manipulate the database and don't want to spend time creating the relevant formulations.
Calendar Slicer Types
Pyramid data modeling enables users to construct these hierarchical date-time groups when designing the ETL, and then add those elements to the query in Discover. However, this solution is only relevant to those users who construct the model in Pyramid; many users query the database directly. In a direct querying scenario, the user may want to add years to the query, while the database only contains a flat date-time hierarchy consisting of date keys. How can this user add 'years' to the query?
Pyramid offers two solutions for this requirement:
- On-the-fly "date part" calculations. Date part calculations produce custom columns which can be added to any part of the query.
- Date Calendars. The Date Calendar is used to filter the query by specified dates or time periods, date ranges, and date formulations. From the calendar slicer, the user selects the required dates or time period and the query is filtered on-the-fly, without creating any custom columns.
Note: Calendar slicers are supported only for SQL models. This functionality is not currently supported for MS OLAP, Tabular, or SAP BW.
Creating a Calendar Slicer
A calendar slicer can only be created using a date-time column. Add the date-time hierarchy (yellow highlight below) to the Filters zone, dropping it onto the Date Calendar sub-menu (purple highlight):
This produces a slicer which is added to the canvas. When you click the slicer, the Date Calendar opens instead of a drop-down list. Continue reading to learn how to navigate the Date Calendar.
Using the Date Calendar
Calendar Type
The calendar slicer features different "Pickers," each designed to meet a different set of user requirements:

The Simple Picker allows you to select the items that should be used to filter the query. To select more than one element, enable Multi Select (purple arrow below). With multi select enabled, you can select multiple elements from any level of granularity (orange highlight).
The example below filters the query by the four dates selected: 5, 6, 12, and 13 January, 2008:

Use the range picker to filter the query by a date range, beginning with the From date, up to and including the To date. Select the required level of granularity, then select the start date from the left, and the end date from the right.
The example below filters the query by all dates between 1 April 2009 and 30 September 2009, inclusive:

Filter the query by a formula based on the selected date element. Start by selecting the granularity level, then select the date element, then choose the required function.
The type of functions available depends on the selected level of granularity:
Granularity
Rather than displaying dates only, the Date Calendar allows you to specify the desired level of granularity, meaning you can choose to display any of the date-time groupings in the calendar and make your selections accordingly.
- Select Years and then select 2010 to filter the query to display data for 2010.
- Select Semesters and then select 2008 > S2 and 2009 > S2 to filter the query by semester 2 of 2008 and 2009.
- Select Quarters and then select 2008 > Q2 and 2009 > Q2 to filter the query by quarter 2 of 2008 and 2009. (The example above shows this selection.)
- Select Months and then select 2010 > Jul and Aug to filter the query by July and August, 2010.
- Select Weeks and then select 2009 and 1, 2, and 3 to filter the query by weeks 1, 2, and 3 of 2009.
- Select Dates and then select 2009 and January and then 3, 4, 17, 18, and 31 to filter the query by January 3, 4, 17, 18, and 31, 2009.
Calendar Selection
The Date Calendar allows selections for dates that exist in the database only. Dates and periods for which there is no data are grayed out. To make a selection from the calendar, start by selecting the required level of granularity, then select the required date or time period.
To assist in making a selection, use the back and forward arrows to move to the next or previous period, and use the up and down buttons to jump to a different month or year.
Back and Forward Buttons
Use the back and forward buttons to navigate through the calendar at the current level of granularity. For example, at the Dates level the calendar displays dates by month (orange highlight below), click the forward arrow to go to the next month, or the back arrow to go to the previous month (purple arrows). Likewise, at the week level, click forward to go to the next year, or back to go to the previous year.
Up and Down Buttons
Use the up and down buttons (orange highlight above) to jump to a different month or year for the current level of granularity. Up buttons indicate that you can go up a level, while down arrows indicate that you can go down a level, without making a filter selection.
Examples
To follow these examples, use the Sample Demo data model.

From the date level, you will see the currently selected year and month. Click the up button once (purple highlight below):
You will now see the months for which there is data in the currently selected year. Each month displays a down arrow, indicating that if you click on a month, you will see the date level:
Click the up button again to see the years, and then select 2010:
You will now see the months in 2010. Select September:
You will now see the dates for 2010, September and you can make a filter selection of dates:

From the weeks, months, quarters, and semesters levels, the up button will show you the years. Set the granularity to Weeks and click the Up button.
You will see the list of years, accompanied by a down arrow. Select 2009:
You will now see all the weeks in 2009, and can select one or more weeks:
Multi Select
The multi select option is supported by the Simple Date Calendar, allowing you to select multiple date-time elements. You can select multiple elements from different granularity levels.
Multi Select is enabled by default; to disable it, clear its checkbox:
Tip: To remove selections from the panel, either click their X icons individually, or click X at the end of the Selections field to remove all.

In this example, all Tuesdays in September 2010 were selected, along with the entire 4th week of the same month:
In this example, Q2 was selected from 2008, 2009, and 2010:
Quick Selection
The quick selection options provide a shortcut selection for filtering by the current, first, or last date-time period at the current level of granularity.
To make a quick selection:
- Start by choosing the granularity level as usual.
- Then, instead of making a selection from the calendar, choose a Quick Selection from the options below.
- Current: Depending on the given level of granularity, selects today's date (if it exists in the system) or the current year, semester, quarter, month, or week. If the current date-time period doesn't exist in the system, the last date-time period will be selected instead.
- First: Selects the first date-time period in the system according to the selected level of granularity. If the granularity is set to Dates, the first date in the system will be selected; if the granularity is set to months, the first month in the system will be selected; and so on.
- Last: Selects the last date-time period in the system according to the selected level of granularity. If the granularity is set to Dates, the last date in the system is selected. If the granularity is set to years, the last year in the system is selected.

Here, the first date in the system was selected:
Here, the granularity is set to Weeks, so the first week was selected:

Here, the last date in the system was selected:
Now the last semester in the system was selected: